﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace NJL.WebManage
{
    public partial class PersonInformation :BasePage
    {
        NJL.BLL.NJL_SYS_ADMIN bllAdmin = new BLL.NJL_SYS_ADMIN();
        NJL.Model.NJL_SYS_ADMIN modelAdmin;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                bind();
            }

        }
        public void bind()
        {
            modelAdmin = bllAdmin.GetModel(USER_ID);
            txtRealName.Text = modelAdmin.REAL_NAME;
            txtQQ.Text = modelAdmin.QQ;
            txtTel.Text = modelAdmin.TEL;
            txtCellPhone.Text = modelAdmin.MOBILE;
            txtMsn.Text = modelAdmin.MSN;
            txtEmail.Text = modelAdmin.EMAIL;
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            modelAdmin = bllAdmin.GetModel(USER_ID);
            modelAdmin.REAL_NAME = txtRealName.Text;
            modelAdmin.QQ = txtQQ.Text;
            modelAdmin.MOBILE = txtCellPhone.Text;
            modelAdmin.MSN = txtMsn.Text;
            modelAdmin.TEL = txtTel.Text;
            modelAdmin.EMAIL = txtEmail.Text;
            if (bllAdmin.Update(modelAdmin))
            {
                Royalsoft.Common.MessageBox.ShowAndRedirect(this, "修改成功", "PersonInformation.aspx");
            }

        }
    }
}